package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.DoGood;
import cn.wolfcode.trip.base.mapper.DoGoodMapper;
import cn.wolfcode.trip.base.service.IDoGoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DoGoodServiceImpl implements IDoGoodService {
    @Autowired
    private DoGoodMapper doGoodMapper;

    /**
     * 查询
     * @param doGood
     * @return
     */
    public DoGood selectOne(DoGood doGood) {
        return doGoodMapper.selectByOne(doGood);
    }

    /**
     * 保存
     * @param doGood
     */
    public void saveOne(DoGood doGood) {
        doGoodMapper.insertByOne(doGood);
    }

    /**
     * 删除
     * @param doGood
     */
    public void deleteOne(DoGood doGood) {
        doGoodMapper.deleteByOne(doGood);
    }

    /**
     * 计数
     * @param doGood
     * @return
     */
    public int selectForCount(DoGood doGood) {
        return doGoodMapper.selectForCount(doGood);
    }
}
